﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sharp.Domain.Model;
using Sharp.Domain.PlatformBoundedContext.UserModule.Aggregates;

namespace Sharp.Domain.PlatformBoundedContext.MessageModule.Aggregates
{
    /// <summary>
    /// 通知
    /// </summary>
    public class Notice : IAggregateRoot<int>
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        [MaxLength(255)]
        public string Content { get; set; }
        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime PublishTime { get; set; }
        /// <summary>
        /// 收件人Id
        /// </summary>
        public int? ReceiverId { get; set; }
 
        /// <summary>
        /// 收件人
        /// </summary>
        [ForeignKey("ReceiverId")]
        public virtual User Recipient { get; set; }
        /// <summary>
        /// 是否已读
        /// </summary>
        public bool IsReaded { get; set; }
        /// <summary>
        /// 阅读时间
        /// </summary>
        public DateTime? ReadedTime { get; set; }
    }
}